const http = require("http");
const fs = require("fs"); //fs可以将文件的内容读出来

const server = http.createServer((request, response) => {

  response.setHeader('content-type','text/html;charset=utf-8');
  // response.end("<h1>这是标题</h1>"); // 可以发送标签
  fs.readFile("./login.html", "utf-8", (err, data) => {
    if (err) throw err;
    response.end(data);
  })
});

server.listen(8080);
